﻿using FS.Common.DotNetBean;
using FS.Common.DotNetCode;
using FS.Common.DotNetUI;
using FS.Business;
using System;
using System.Collections;
using System.Data;

namespace FS.Web.BLL.Visa
{
    public partial class Visa_VisaDetailFailForm : PageBase
    {
        private string _key;
        private visa_dao _visa = new visa_dao();
        protected void Page_Load(object sender, EventArgs e)
        {
            this._key = base.Request["key"];
            if (!base.IsPostBack)
            {
                this.rejectdate.Value = DateTime.Now.ToString("yyyy-MM-dd");
                if (!string.IsNullOrEmpty(this._key))
                {
                    this.InitData();
                }
            }
        }

        private void InitData()
        {
            string ls_cusname = _visa.GetVisaDetailForm(this._key);
            this.customer.Value = ls_cusname;            
        }
        protected void Save_Click(object sender, EventArgs e)
        {
            string ls_date = this.rejectdate.Value;
            string ls_reason = this.reason.Value.Trim();
           
            int rtn = _visa.UpdateDetailRejectDate(this._key, ls_date, ls_reason, _userid, _username,_disname);
            if (rtn>0)
            {
                ShowMsgHelper.AlertMsg("操作成功！");
            }
            else
            {
                ShowMsgHelper.Alert_Error("操作失败！");
            }
        }
    }
}